import type { PropertyListType, GetPropertyParamsType, EnterpriseType, buildingType, PaymentParamsType, AddPropertyParams } from "@/types/property"
import { myGet, myPost, myRequest } from "@/utils/reuqest"

// 获取物业费账单API
export const getPropertyAPI = (params: GetPropertyParamsType) => {
    return myGet<PropertyListType>('/park/propertyfee', params)
}

// 查询所有企业API
export const getEnterpriseDataAPI = () => {
    return myGet<EnterpriseType[]>('/park/all/enterprise')
}

// 查询所有楼宇
export const getBuildingDataAPI = () => {
    return myGet<buildingType[]>('/park/all/building')
}

// 预算金额
export const getPaymentAPI = (data: PaymentParamsType) => {
    return myPost<string>('/park/propertyfee/pre/payment', data)
}

// 添加物业费
export const addPropertyAPI = (data: AddPropertyParams) => {
    return myPost('/park/propertyfee', data)
}

// 删除物业费账单
export const deletePropertyAPI = (id: number) => {
    return myRequest({
        url: `/park/propertyfee/${id}`,
        method: 'DELETE'
    })
}
